class NeighborhoodCollection
{
public:
    void add(const Neighborhood &neigh);
    void addAll(const FrameGrid &frameGrid, int size);
    void getMostFrequent(int num, set<Neighborhood> &out) const;
    void getMostFrequentWithCount(int num, set<pair<Neighborhood, int> > &out) const;

private:
    map<Neighborhood, int> counts;
};